<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
 <head>
  <title>inputEx - ColorPickerField Usage</title>

<!-- YUI CSS -->
<link rel="stylesheet" type="text/css" href="../lib/yui/reset-fonts/reset-fonts.css">
<link rel="stylesheet" type="text/css" href="../lib/yui/container/assets/container.css"> 
<link rel="stylesheet" type="text/css" href="../lib/yui/assets/skins/sam/skin.css">

<!-- InputEx CSS -->
<link type='text/css' rel='stylesheet' href='../css/inputEx.css' />

<!-- Demo CSS -->
<link rel="stylesheet" type="text/css" href="css/demo.css"/>
<link rel="stylesheet" type="text/css" href="css/dpSyntaxHighlighter.css">

 </head>

 <body class="yui-skin-sam">

<h1>inputEx - ColorPickerField Usage</h1>

<p style="margin-left: 20px;">This field is a wrapper around the <a href="http://developer.yahoo.com/yui/colorpicker/">YUI ColorPicker widget</a>.</p>


<!-- Example 1 -->
<div class='exampleDiv'>
	<h2>Basic ColorPickerField creation</h2>
	<p>Use the following code to create a basic inputEx ColorPickerField.</p>
	<div class='demoContainer' id='container1'></div>
	<div class='codeContainer'>
		<textarea name="code" class="JScript">
			new inputEx.ColorPickerField({parentEl: 'container1', label: 'Choose a color', description: 'Click to view the available colors' });
		</textarea>
	</div>
</div>



<!-- Example 2 -->
<div class='exampleDiv'>
	<h2>Smaller ColorPickerField</h2>
	<p>Use the following code to create a ColorPickerField without controls</p>
	<div class='demoContainer' id='container2'></div>
	<div class='codeContainer'>
		<textarea name="code" class="JScript">
			var field = new inputEx.ColorPickerField({parentEl: 'container2', label: 'Choose a color', value:'#2626AF', colorPickerOptions:{showcontrols:false} });
			
			// Register the 'updatedEvt' and log the value to the page
			var logDiv = inputEx.cn('div', null, null, "Log :");
			YAHOO.util.Dom.get('container2').appendChild(logDiv);
			field.updatedEvt.subscribe(function(e,params) {
				var val = params[0];
				logDiv.appendChild( inputEx.cn('div', null, null, "Updated at "+(new Date())+" with value: "+val) );
			});
			
		</textarea>
	</div>
</div>


<!-- YUI Library -->
<script type="text/javascript" src="../lib/yui/utilities/utilities.js"></script>
<script type="text/javascript" src="../lib/yui/slider/slider-min.js"></script>
<script type="text/javascript" src="../lib/yui/colorpicker/colorpicker-min.js"></script>
<script type="text/javascript" src="../lib/yui/container/container_core-min.js"></script>
<script type="text/javascript" src="../lib/yui/menu/menu-min.js"></script>
<script type="text/javascript" src="../lib/yui/button/button-min.js"></script>

<!-- InputEx -->
<script src="../js/inputex.js"  type='text/javascript'></script>
<script src="../js/Field.js"  type='text/javascript'></script>
<script src="../js/fields/ColorPickerField.js"  type='text/javascript'></script>

<!-- inputEx examples -->
<script src="js/dpSyntaxHighlighter.js"></script>
<script src="inputex-examples.js"></script>

 </body>
</html>